


<?php
//include "../../onegate_function.php";

include "template.php";
// Lay cac thong so cau hinh chung
include "../app_global.php";
// Lay cac hang so dung chung
include "../const.php";
// Ham thuc hien lay ten file va hien thi noi dung
include "../isa-lib/isa-function/isa_public_function.php";
require_once("../isa-lib/nusoap/nusoap.php");
include "../isa-lib/isa-function/prax.php";
include_once("../isa-lib/isa-function/class_xslt.php");
include "../db_const.php";
include "../connect_ado.php";
include "../test_login.php";
include "../init_session.php";
include "../onegate_function.php";
include "app_local.php";
if (!isset($_REQUEST['modal_dialog_mode'])) {
	include "../dsp_header.php";
	//include "dsp_header_view.php";
}else{
	include "dsp_modal_dialog_header.php";
}

?>
<script src="isa_util.js" ></script>

<script src="js_calendar.js" ></script>


<script src="../isa-lib/isa-js/isa_util.js"></script>
<script src="util.js"></script>
<?php
$template = new Template();
$fuseaction = "";
$fuseaction = $_GET["fuseaction"];
//
$user_id = $_REQUEST["id"];
$v_limit_row = $_REQUEST["hdn_record_number_page"];
$use_page_or_row_limit = false;
if ($v_limit_row == null || $v_limit_row == "") {
	$v_limit_row = _CONST_NUMBER_OF_ROW_PER_LIST;
} else {
	$use_page_or_row_limit = true;
}
$v_page = $_REQUEST["hdn_page"];
if ($v_page == null || $v_page == "") {
	$v_page = 1;
} else {
	$use_page_or_row_limit = true;
}
//echo $fuseaction;
switch($fuseaction) {
	case "GET_LIST_BY_USER_ID";	
	   // break;
		include "qry_record_by_user_id.php";
		$user_name = _get_item_attr_by_id($_SESSION['arr_all_staff'], $user_id, 'name');
		$form_number = 0;
		$id_unit = $_REQUEST["id_unit"];
		include "dsp_record_by_user_id.php";
		break;
	case "GET_LIST_BY_UNIT_ID";
		//break;
		$id_unit = $_REQUEST["id_unit"];
		$array_unit[0][0] = $id_unit;
		$arr_all_user = get_arr_child_staff($array_unit);
		//var_dump($arr_all_user);
		include "qry_record_by_unit_id.php";
		include "dsp_record_by_unit_id.php";
		break;
		//code chuongnlt//
	case "date";
	   // break;
		//header('Location:index1.php');
		
        include "qry_record_by_date.php";
		include "index1.php";
		$user_name = _get_item_attr_by_id($_SESSION['arr_all_staff'], $user_id, 'name');
		$form_number = 0;
		$id_unit = $_REQUEST["id_unit"];
		include "dsp_record_by_date.php";
//var_dump($_SESSION['arr_all_staff']);
//echo $_SESSION['arr_all_staff'];
// $_SESSION['arr_all_staff']['name'];
		break;

		//code chuongnlt//
	default:
		
		include "dsp_all_staff_by_unit.php";
		$template->set_filenames(array("body"=>"template/view.tpl"));
		$template->pparse("body");
}


















function onegate_pagebreak_selectbox_vunh($p_total_record,$p_current_page,$p_number_record_per_page,$v_fuseaction,$form_number){
	$v_html_string = "";
	if($p_total_record%$p_number_record_per_page==0){
		$v_number_page = (int)($p_total_record/$p_number_record_per_page);
	}else{
		$v_number_page = (int)($p_total_record/$p_number_record_per_page)+1;		
	}
	$v_html_string = $v_html_string . "T&#7893;ng s&#7889;&nbsp;" . $v_number_page . "&nbsp;trang.&nbsp;&nbsp;Xem &nbsp;" . "<select class='normal_selectbox' name='sel_page' style='width:auto' title='Ch&#7885;n trang mu&#7889;n xem' style='width:40'" . "onChange='page_onchange_vunh(this,&quot;" . $v_fuseaction ."&quot;,".$form_number.")'" . "onKeyDown='change_focus(document.forms[0],this)' >";
	for ($i=1; $i<=$v_number_page;$i++){				
		if ($p_current_page == $i){
			$v_select = " selected ";
		}else{
			$v_select = " ";
		}
		$v_html_string = $v_html_string . "<option id='' value='$i' name='$i' $v_select> " . "Trang &nbsp;" . $i  . "</option>";
	}
	$v_html_string = $v_html_string . "</select>";
	return $v_html_string;
}

function onegate_change_record_number_page_vunh($v_value,$v_fuseaction,$form_number){
	$v_html_string = "";
	$v_sql = "ONEGATE_ListGetAllbyCode " . "SO_HS_TREN_TRANG";
	$v_html_string = $v_html_string . "Hi&#7875;n th&#7883; ";
	$v_html_string = $v_html_string . "<select class='normal_selectbox' name='cbo_nuber_record_page' style='width:60' onChange='page_record_number_onchange_vunh(this,&quot;" . $v_fuseaction ."&quot;,".$form_number.")'" . "onKeyDown='change_focus(document.forms[0],this)'>";
	$v_html_string = $v_html_string . _generate_select_option(Query_Data($v_sql),0,0,1,$v_value);
	$v_html_string = $v_html_string . "</select>";	
	$v_html_string = $v_html_string . "&nbsp;h&#7891; s&#417;/1 trang";
	return $v_html_string;
}
if (!isset($_REQUEST['modal_dialog_mode'])) {
	include "../dsp_footer.php";
	//include "dsp_ader_view.php";
}else{
	include "../dsp_modal_dialog_footer.php";
}
?>
<TD class=body1 vAlign=top 
width="1%"></TD>
</table>
